﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace AircraftCarrier.Lib
{
    class Screenshot
    {
        public static Bitmap GetCurScreenshot(Point location, Size ScreenshotSize)
        {
            Bitmap bmpCatched = new Bitmap(ScreenshotSize.Width, ScreenshotSize.Height);
            Graphics g = Graphics.FromImage(bmpCatched);
            Size mySize = ScreenshotSize;
            Point myLocation = location;
            myLocation.Offset(4, 4);
            mySize.Height = mySize.Height - 8;
            mySize.Width = mySize.Width - 8;
            g.CopyFromScreen(myLocation, new Point(0, 0), mySize);
            return bmpCatched;
        }
    }
}
